package xcmg.device.web.userInfo;

import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import xcmg.device.infra.BasicController;
import xcmg.device.service.userinfo.UserService;
import yb.ecp.fast.dto.ProfileDTO;
import yb.ecp.fast.infra.annotation.FastMappingInfo;

import java.util.Arrays;

@RestController
@RequestMapping("/user")
public class UserController extends BasicController {
    @Autowired
    private UserService userService;

    @PostMapping(value = "/export")
    @FastMappingInfo(needLogin = true)
    @ApiOperation("根据勾选数据导出")
    public void export(@RequestParam("userids") String[] userids)throws Exception {
        userService.export(userids);
    }

    @PostMapping(value = "/exportAll")
    @FastMappingInfo(needLogin = true)
    @ApiOperation("导出所有数据")
    public void exportAll(ProfileDTO condition)throws Exception {
        userService.exportAll(condition, getUserId());
    }
}
